/**
 * Copyright © 2024 北京迅安网络系统有限责任公司 Co., Ltd. All rights reserved.
 */

#ifndef __OSID_LOG_H__
#define __OSID_LOG_H__

#include <string>

#include "hilog/log.h"

static constexpr int LOG_DOMAIN_ID_OSID = 0xD002200;
static constexpr OHOS::HiviewDFX::HiLogLabel LABEL = { LOG_CORE, LOG_DOMAIN_ID_OSID, "fri_osid@1.0.1" };

#define MAKE_FILE_NAME (strrchr(__FILE__, '/') + 1)
//#define HILOG(level, fmt, ...) void
#define HILOG(level, fmt, ...)     \
    OHOS::HiviewDFX::HiLog::level( \
        LABEL, "[%{public}s(%{public}s:%{public}d)]" fmt, __FUNCTION__, MAKE_FILE_NAME, __LINE__, ##__VA_ARGS__)

#define HILOGD(fmt, ...) HILOG(Debug, fmt, ##__VA_ARGS__)
#define HILOGI(fmt, ...) HILOG(Info, fmt, ##__VA_ARGS__)
#define HILOGW(fmt, ...) HILOG(Warn, fmt, ##__VA_ARGS__)
#define HILOGE(fmt, ...) HILOG(Error, fmt, ##__VA_ARGS__)
#define HILOGF(fmt, ...) HILOG(Fatal, fmt, ##__VA_ARGS__)

#endif